// This file is part of Acala.

// Copyright (C) 2020-2025 Acala Foundation.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0

// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.

// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.

// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.

//! Autogenerated weights for module_cdp_treasury
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 35.0.1
//! DATE: 2024-04-29, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! HOSTNAME: `ip-172-31-41-141`, CPU: `Intel(R) Xeon(R) Platinum 8375C CPU @ 2.90GHz`
//! WASM-EXECUTION: Compiled, CHAIN: Some("acala-dev"), DB CACHE: 1024

// Executed Command:
// target/production/acala
// benchmark
// pallet
// --chain=acala-dev
// --steps=50
// --repeat=20
// --pallet=*
// --extrinsic=*
// --wasm-execution=compiled
// --heap-pages=4096
// --template=./templates/runtime-weight-template.hbs
// --output=./runtime/acala/src/weights/

#![cfg_attr(rustfmt, rustfmt_skip)]
#![allow(unused_parens)]
#![allow(unused_imports)]

use frame_support::{traits::Get, weights::Weight};
use sp_std::marker::PhantomData;

/// Weight functions for module_cdp_treasury.
pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> module_cdp_treasury::WeightInfo for WeightInfo<T> {
	// Storage: `Tokens::Accounts` (r:1 w:0)
	// Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(147), added: 2622, mode: `MaxEncodedLen`)
	// Storage: `AuctionManager::TotalCollateralInAuction` (r:1 w:1)
	// Proof: `AuctionManager::TotalCollateralInAuction` (`max_values`: None, `max_size`: Some(67), added: 2542, mode: `MaxEncodedLen`)
	// Storage: `CdpTreasury::ExpectedCollateralAuctionSize` (r:1 w:0)
	// Proof: `CdpTreasury::ExpectedCollateralAuctionSize` (`max_values`: None, `max_size`: Some(67), added: 2542, mode: `MaxEncodedLen`)
	// Storage: `AuctionManager::TotalTargetInAuction` (r:1 w:1)
	// Proof: `AuctionManager::TotalTargetInAuction` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`)
	// Storage: `Auction::AuctionsIndex` (r:1 w:1)
	// Proof: `Auction::AuctionsIndex` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
	// Storage: `System::Account` (r:1 w:1)
	// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
	// Storage: `AuctionManager::CollateralAuctions` (r:0 w:50)
	// Proof: `AuctionManager::CollateralAuctions` (`max_values`: None, `max_size`: Some(139), added: 2614, mode: `MaxEncodedLen`)
	// Storage: `Auction::AuctionEndTime` (r:0 w:50)
	// Proof: `Auction::AuctionEndTime` (`max_values`: None, `max_size`: Some(32), added: 2507, mode: `MaxEncodedLen`)
	// Storage: `Auction::Auctions` (r:0 w:50)
	// Proof: `Auction::Auctions` (`max_values`: None, `max_size`: Some(70), added: 2545, mode: `MaxEncodedLen`)
	/// The range of component `b` is `[1, 50]`.
	fn auction_collateral(b: u32, ) -> Weight {
		// Proof Size summary in bytes:
		//  Measured:  `2043`
		//  Estimated: `3612`
		// Minimum execution time: 40_200 nanoseconds.
		Weight::from_parts(38_000_419, 3612)
			// Standard Error: 20_286
			.saturating_add(Weight::from_parts(9_270_883, 0).saturating_mul(b.into()))
			.saturating_add(T::DbWeight::get().reads(6))
			.saturating_add(T::DbWeight::get().writes(6))
			.saturating_add(T::DbWeight::get().writes((3_u64).saturating_mul(b.into())))
	}
	// Storage: `Tokens::Accounts` (r:8 w:8)
	// Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(147), added: 2622, mode: `MaxEncodedLen`)
	// Storage: `AuctionManager::TotalCollateralInAuction` (r:1 w:0)
	// Proof: `AuctionManager::TotalCollateralInAuction` (`max_values`: None, `max_size`: Some(67), added: 2542, mode: `MaxEncodedLen`)
	// Storage: `Dex::TradingPairStatuses` (r:5 w:0)
	// Proof: `Dex::TradingPairStatuses` (`max_values`: None, `max_size`: Some(195), added: 2670, mode: `MaxEncodedLen`)
	// Storage: `Dex::LiquidityPool` (r:5 w:1)
	// Proof: `Dex::LiquidityPool` (`max_values`: None, `max_size`: Some(126), added: 2601, mode: `MaxEncodedLen`)
	// Storage: `StableAsset::Pools` (r:2 w:1)
	// Proof: `StableAsset::Pools` (`max_values`: None, `max_size`: None, mode: `Measured`)
	// Storage: `AggregatedDex::AggregatedSwapPaths` (r:1 w:0)
	// Proof: `AggregatedDex::AggregatedSwapPaths` (`max_values`: None, `max_size`: None, mode: `Measured`)
	// Storage: `Homa::TotalStakingBonded` (r:1 w:0)
	// Proof: `Homa::TotalStakingBonded` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
	// Storage: `Homa::ToBondPool` (r:1 w:0)
	// Proof: `Homa::ToBondPool` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
	// Storage: `Tokens::TotalIssuance` (r:2 w:1)
	// Proof: `Tokens::TotalIssuance` (`max_values`: None, `max_size`: Some(67), added: 2542, mode: `MaxEncodedLen`)
	// Storage: `Homa::TotalVoidLiquid` (r:1 w:0)
	// Proof: `Homa::TotalVoidLiquid` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
	// Storage: `System::Account` (r:3 w:1)
	// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
	// Storage: `EvmAccounts::EvmAddresses` (r:1 w:0)
	// Proof: `EvmAccounts::EvmAddresses` (`max_values`: None, `max_size`: Some(60), added: 2535, mode: `MaxEncodedLen`)
	// Storage: `AssetRegistry::AssetMetadatas` (r:1 w:0)
	// Proof: `AssetRegistry::AssetMetadatas` (`max_values`: None, `max_size`: None, mode: `Measured`)
	fn exchange_collateral_to_stable() -> Weight {
		// Proof Size summary in bytes:
		//  Measured:  `4610`
		//  Estimated: `21966`
		// Minimum execution time: 319_651 nanoseconds.
		Weight::from_parts(326_030_000, 21966)
			.saturating_add(T::DbWeight::get().reads(32))
			.saturating_add(T::DbWeight::get().writes(12))
	}
	// Storage: `CdpTreasury::ExpectedCollateralAuctionSize` (r:0 w:1)
	// Proof: `CdpTreasury::ExpectedCollateralAuctionSize` (`max_values`: None, `max_size`: Some(67), added: 2542, mode: `MaxEncodedLen`)
	fn set_expected_collateral_auction_size() -> Weight {
		// Proof Size summary in bytes:
		//  Measured:  `997`
		//  Estimated: `0`
		// Minimum execution time: 12_783 nanoseconds.
		Weight::from_parts(13_227_000, 0)
			.saturating_add(T::DbWeight::get().writes(1))
	}
	// Storage: `Tokens::Accounts` (r:2 w:2)
	// Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(147), added: 2622, mode: `MaxEncodedLen`)
	// Storage: `System::Account` (r:2 w:1)
	// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
	fn extract_surplus_to_treasury() -> Weight {
		// Proof Size summary in bytes:
		//  Measured:  `1468`
		//  Estimated: `6234`
		// Minimum execution time: 35_718 nanoseconds.
		Weight::from_parts(36_774_000, 6234)
			.saturating_add(T::DbWeight::get().reads(4))
			.saturating_add(T::DbWeight::get().writes(3))
	}
}
